﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OA.Core;

namespace OA.Model
{
    /*
     SELECT  dbo.Voucher.No, dbo.Voucher.Title, dbo.Voucher.ApplicationDate, dbo.Voucher.Sponsor, dbo.Voucher.CurrentApprover, 
                   dbo.Approvals.EmpID, dbo.Approvals.SourceEmpID, dbo.Approvals.VoucherID, dbo.Approvals.ID
FROM      dbo.Approvals INNER JOIN
                   dbo.Voucher ON dbo.Approvals.VoucherID = dbo.Voucher.ID
         
         */
    public class VoucherApproval
    {
        public int ID { get; set; }

        public int CustomFormID { get; set; }

        public int VoucherStatus { get; set; }

        public string VoucherStatusName { get { return MyEnum.GetEnumNameByValue(this.VoucherStatus, typeof(VoucherType)); } }

        public int ApprovalStatus { get; set; }

        public string ApprovalStatusName { get { return MyEnum.GetEnumNameByValue(this.ApprovalStatus, typeof(ApprovalType)); } }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime? ApplicationDate { get; set; }

        /// <summary>
        /// 到达时间
        /// </summary>
        public DateTime? ArrivalTime { get; set; }

        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? FinishTime { get; set; }

        public string No { get; set; }

        public int VoucherID { get; set; }        

        public string Title { get; set; }

        /// <summary>
        /// 当前处理人
        /// </summary>
        public string CurrentApprover { get; set; }

        /// <summary>
        /// 发起人
        /// </summary>
        public string Sponsor { get; set; }

        public string SponsorName { get; set; }

        public string SourceEmpID { get; set; }

        public string SourceEmpName { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string Pic { get; set; }

        public int TypeID { get; set; }

        public string EmpID { get; set; }

        public string DepartmentName { get; set; }

        public string PositionName { get; set; }

        public int DepartmentID { get; set; }

        public int PositionID { get; set; }

        public string Explain { get; set; }

    }

    public class VoucherApproval2 : VoucherApproval
    {
        
        public string CustomFormName { get; set; }
    }

    /// <summary>
    /// 我的发起
    /// </summary>
    public class LaunchedResult : BaseResult
    {
        public string MyPic { get; set; }

        public List<LaunchedItem> List { get; set; }
    }

    public class ApproverEmpInfo
    {
        public string Name { get; set; }

        public string Img { get; set; }

        public string DepartmentName { get; set; }

        public string PositionName { get; set; }
    }

    public class LaunchedItem
    {
        public int ID { get; set; }

        /// <summary>
        /// 单据名称
        /// </summary>
        public string CustomFormName { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public int Status { get; set; }

        public string StatusName { get { return MyEnum.GetEnumNameByValue(this.Status, typeof(VoucherType)); } }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime? ApplicationDate { get; set; }

        /// <summary>
        /// 到达时间
        /// </summary>
        public DateTime? ArrivalTime { get; set; }

        /// <summary>
        /// 当前处理人
        /// </summary>
        public List<ApproverEmpInfo> CurrentApprovers { get; set; }


        

        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? FinishTime { get; set; }


        public string No { get; set; }


        public string Title { get; set; }
    }



}
